<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--
@html_name: 01async函数
@description: The past cannot be redeemed, the future can be changed.
@author: Jason Black
@create: 2023/6/27 10:15:43
-->
<script type="text/javascript">
    // async 函数返回值为一个promise对象
    async function methodTest() {
        return new Promise((resolve, reject) => {
            reject("error")
        })
    }

    let f = methodTest()
    f.then(value => {
        console.log(value)
    }, reason => {
        console.warn(reason)
        console.error(reason)
        console.log(reason)
    })
</script>
</body>
</html>